package topcoder;

public class RainyRoad {

	public String isReachable(String[] road){
		short j = 0;
		
		for(short i = 0; i < road[0].length()-1; i++){
			if(road[j].charAt(i+1) == 'W'){
				if(j == 0){
					if(road[1].charAt(i+1) == 'W')
						return "NO";
					else
						j = 1;
				}
				else{
					if(road[0].charAt(i+1) == 'W')
						return "NO";
					else
						j = 0;
				}
			}
		}
		
		return "YES";
	}
}
